package v1

import (
	"gitee.com/xuaxu/go-gin/pkg/app"
	"gitee.com/xuaxu/go-gin/pkg/e"
	article_service "gitee.com/xuaxu/go-gin/service/article"
	"github.com/gin-gonic/gin"
	"github.com/unknwon/com"
	"net/http"
)

type Data1 struct {
	List  []article_service.List
	Count int
}

func SyncArticle(c *gin.Context) {
	appG := app.Gin{C: c}
	page := com.StrTo(c.PostForm("page")).MustInt()
	size := com.StrTo(c.PostForm("size")).MustInt()
	list, count, _ := article_service.SyncData(page, size)
	var list1 Data1
	list1.List = list
	list1.Count = count
	appG.Response(http.StatusOK, e.SUCCESS, list1)
}
